package stdio.costa.imoca.notification.email;

import java.util.List;

public class EmailTemplateProcessor {

	public static String process(String content,
			List<EmailTemplateVariable> variables) {

		if (content == null || variables == null || variables.isEmpty()) {
			return content;
		}

		for (EmailTemplateVariable variable : variables) {
			content = content.replaceAll("\\" + variable.getName(),
					variable.getValue());
		}

		return content;
	}
	
	public static void main(String[] args){
		String str = "please click <a hred=http://imoca/$address$/> to reset your password.";
		
		str = str.replaceAll("\\" + "$a", "abc");
		System.out.println(str);
	}
}
